#include "egpd.h"

void
handle_signal(int signum)
{
   switch (signum) {
   case SIGTERM:
      warning("\n%s:%s:%d received TERM(%d) signal", 
            __progname, __func__, __LINE__, signum);
      break;

   case SIGHUP:
      warning("\n%s:%s:%d received HUP(%d) signal", 
            __progname, __func__, __LINE__, signum);
      break;

   case SIGINT:
      warning("\n%s:%s:%d received INTERRUPT(%d) signal", 
            __progname, __func__, __LINE__, signum);
      break;

   case SIGPIPE:
      warning("\n%s:%s:%d received SIGPIPE(%d) signal, possible broken stream",
            __progname, __func__, __LINE__, signum);
      cleanup();
      break;
   }

   _exit(2);
}
